package jtk.project4.fleet.ibatis.dao;

import java.sql.SQLException;
import java.util.List;

import jtk.project4.fleet.domain.Po;
import jtk.project4.fleet.domain.RbLoc;


public class PoDao extends IbatisDao {
	public List selectPo() throws SQLException {
		List selectPo = null;
			selectPo =getSqlMap().queryForList("SELECT_ALL_PO", null);
		return selectPo;
	}
	
	public Po insertPo(Po po) throws SQLException{
		return (Po) getSqlMap().insert("INSERT_PO",po);
	}

	public int updatePo(Po po) throws SQLException{
		return (int) getSqlMap().update("UPDATE_PO", po);
	}
	
	public int deletePo(Po po) throws SQLException{
		return (int) getSqlMap().delete("DELETE_PO", po);
	}
	
	public static void main (String args[]) throws SQLException
	{
		Po po;
		po = new Po();
		/*
		// INSERT PO
		po.setBuyer("tes");
		new PoDao().insertPo(po);
		
		*/
		/*
		// SELECT ALL PO
		List <Po> pos;
		pos = new PoDao().selectPos();
		System.out.println(pos.size());
		*/
		
		/*
		 // UPDATE PO
		 po.setBuyer("y2");
		 po.setPoId(3);
		 new PoDao().updatePo(po);
		*/
		
		/*
		// DELETE PO
		po.setPoId(1);
		new PoDao().deletePo(po);
		*/
		
		
	}

}
